package router

import (
	"github.com/gogf/gf/frame/g"
	"github.com/gogf/gf/net/ghttp"
	"websocket/app/api/index"
	"websocket/app/service/middleware"
	"websocket/app/service/websocket/privater"
)

func init() {
	s := g.Server()
	s.Use(middleware.CORS)
	s.BindHandler("/ws", privater.Upgrade)
	s.Group("/", func(group *ghttp.RouterGroup) {
		group.ALL("/", index.Index)
		group.ALL("/offline", index.Offline)
		group.ALL("/websocket", index.Websocket)
	})
}
